package leetcode.doublepointer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;

// 1163. 按字典序排在最后的子串
public class LastSubstring {



    // 暴力法---正确，但是超时
    public String lastSubstring(String s) {

        List<String> list = new ArrayList<>();
        for (int i = 0; i < s.length(); i++) {
            for (int j = i+1; j <= s.length(); j++) {
                list.add(s.substring(i,j));
            }
        }
        return Collections.max(list);
    }
}
